<?php

/**
 * UniversityNews form.
 *
 * @package    Amman to London
 * @subpackage form
 * @author     Adel Abu-Saif <adeljas@msn.com>
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class UniversityNewsForm extends BaseUniversityNewsForm {

    public function configure() {
        
        sfContext::getInstance()->getConfiguration()->loadHelpers(array('Url'));
        
        $this->widgetSchema['image_en'] = new sfWidgetFormInputFile(array('path' => 'uploads/university_news_en/'));
        $this->validatorSchema['image_en'] = new sfValidatorFile(
                        array(
                            'path' => sfConfig::get('sf_upload_dir') . '/university_news_en/'
                            , 'required' => $this->getObject()->isNew()
                        )
        );
        $this->widgetSchema['image_ar'] = new sfWidgetFormInputFile(array('path' => 'uploads/university_news_ar/'));
        $this->validatorSchema['image_ar'] = new sfValidatorFile(
                        array(
                            'path' => sfConfig::get('sf_upload_dir') . '/university_news_ar/'
                            , 'required' => $this->getObject()->isNew()
                        )
        );
        
        $this->widgetSchema['text_en']->setLabel('News Text ( English )');
        $this->widgetSchema['text_ar']->setLabel('News Text ( Arabic )');
        $this->widgetSchema['title_en']->setLabel('News Title ( English )');
        $this->widgetSchema['title_ar']->setLabel('News Title ( Arabic )');
        $this->widgetSchema['image_en']->setLabel('News Image ( English )');
        $this->widgetSchema['image_ar']->setLabel('News Image ( Arabic )');
        
		$this->widgetSchema['university_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('University'), 'add_empty' => '[ General ]'));
		$this->validatorSchema['university_id'] = new sfValidatorInteger(array('required'=> false ));
		
    }

}
